<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>易买网 - 首页</title>
    <link type="text/css" rel="stylesheet" href="/css/style.css"/>
    <script type="text/javascript" src="/scripts/function.js"></script>
</head>

<body>
<%@ include file="/WEB-INF/common/head.jsp" %>
<div id="main" class="wrap">
    <%@ include file="/WEB-INF/common/left.jsp"%>
    <div class="main">
        <div class="price-off">
            <h2>商品列表</h2>
            <ul class="product clearfix">
                <c:forEach items="${productPage.records}" var="product">
                    <li>
                        <dl>
                            <dt><a href="/product/product_info?id=${product.id}"><img src="${product.fileName}"/></a>
                            </dt>
                            <dd class="title"><a href="product-view.html" target="_blank">${product.description}</a>
                            </dd>
                            <dd class="price">${product.price}</dd>
                        </dl>
                    </li>
                </c:forEach>
            </ul>

            <div class="pager">
                <ul class="clearfix">
                    <li><a href="/index?currentPage=${productPage.current==1?1:productPage.current-1}">上一页</a>
                    </li>
                    <c:forEach var="index" begin="1" end="${totalPage}" step="1">
                        <li class="current"><a href="/index?currentPage=${index}">${index}</a></li>
                    </c:forEach>
                    <li>
                        <a href="/index?currentPage=${productPage.current == totalPage?totalPage:productPage.current+1}">下一页</a>
                    </li>
                </ul>
            </div>

        </div>
        <div class="side">
            <div class="spacer"></div>
            <div class="news-list">
                <h4>新闻动态</h4>
                <ul>
                    <c:forEach items="${newsPage.records}" var="newsPage">
                        <li><a href="/news/news_info?id=${newsPage.id}">${newsPage.title}</a></li>
                    </c:forEach>
                </ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<%@ include file="/WEB-INF/common/footer.jsp" %>
</body>
</html>
